/**
 * Copyright (C), 2024, Y2 T205
 * FileName: ch02_03
 * Author: Lenovo
 * Date: 2024-01-17 12:25
 * Description:
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */


package com.example.multithreading;


/**
 * 〈一句话功能简述〉<br>
 * 〈〉
 *
 * @author Lenovo
 * @create 2024-01-17
 * @since 1.0.0
 */

public class ch02_03 {

    public static void main(String[] args) {

        Thread t1= new Thread("t1");
        ThreadGroup group =new ThreadGroup("TestGroup");
        Thread t2 =new Thread(group,"t2");
        ThreadGroup mainThreadGroup = Thread.currentThread().getThreadGroup();

        System.out.println("main thread belong group"+mainThreadGroup.getName());
        System.out.println(mainThreadGroup==t1.getThreadGroup());
        System.out.println(mainThreadGroup==t2.getThreadGroup());
        System.out.println(group ==t2.getThreadGroup());
        System.out.println(group.getName());
    }

}
